package me.hellp.helloworld.design.builder;

import java.util.List;

public class HtmlFileBuilder implements Builder{

	private String head;
	private String body;
	private String foot;
	
	@Override
	public void buildHeader(String header) {
		this.head = "HTML Head " + header;
	}

	@Override
	public void buildBody(List<String> list) {
		StringBuilder builder = new StringBuilder();
		for(String s : list){
			builder.append("<p>" + s + "</p>");
		}
		
		this.body = builder.toString();
	}

	@Override
	public void buildFooter(String footer) {
		this.foot = "HTML Footer " + footer;
	}

	@Override
	public Product getProduct() {
		return new HtmlProduct(this.head + this.body + this.foot);
	}

}
